home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / source / gfxfx / horline.pas < prev    next >
Pascal/Delphi Source File  |  1994-04-25  |  575b  |  34 lines

  1.  
  2. {$g+}
  3. program horline;
  4. uses crt;
  5. { Horizontal line routine (for polygons), by Bas van Gaalen, Holland, PD }
  6. procedure hline(x1,x2,y:word; c:byte); assembler;
  7. asm
  8.   mov es,sega000
  9.   mov bx,[x1]
  10.   mov cx,[x2]
  11.   cmp bx,cx
  12.   jle @skip
  13.   xchg bx,cx
  14.  @skip:
  15.   mov ax,[y]
  16.   shl ax,6
  17.   mov di,ax
  18.   shl ax,2
  19.   add di,ax
  20.   add di,bx
  21.   sub cx,bx
  22.   mov al,[c]
  23.   rep stosb
  24. end;
  25.  
  26. begin
  27.   asm mov ax,13h; int 10h; end;
  28.   randomize;
  29.   repeat
  30.     hline(random(320),random(320),random(200),random(256));
  31.   until keypressed;
  32.   asm mov ax,3; int 10h; end;
  33. end.
  34.